"21"="Other",
"22" ="Retain All",
"23" = "Retain Only Syria")) +
coord_flip()
dev.off()
df$CoB.Excluded <- ifelse(df$CoB.Excluded==22,0,
ifelse(df$CoB.Excluded==23,-1,
df$CoB.Excluded))
####
#### Eroll Kuhn & Rahsaan Maxwell
#### Main Plot
### 10.2020
rm(list=ls())
library(tidyverse)
library(gridExtra)
# read in frame
df <- read.csv("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/5q.Robustness, Leave-One-Out CoB/Plot/TableForPlot.csv")
# pre-processing
df <- data.frame(df)
#df <- subset(df,df$CoB.Excluded!=23)
df$CoB.Excluded <- ifelse(df$CoB.Excluded==22,0,
ifelse(df$CoB.Excluded==23,-1,
df$CoB.Excluded))
df$facet_lab <- ifelse(df$Variable=="% Foreign-Born",1,
ifelse(df$Variable=="% Non-EU Foreign-Born",2,
ifelse(df$Variable=="% from Arabic-Speaking Countries",3,
ifelse(df$Variable=="% Co-National",4,NA))))
df$facet_lab <- factor(df$facet_lab,
levels = c(1,2,3,4),
labels = c("% Foreign-Born",
"% Non-EU Foreign-Born",
"% from Arabic-Speaking Countries",
"% Co-National"))
ggplot(df) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower95,ymax=Upper95),lwd=0.25,fatten = .2) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower90,ymax=Upper90),lwd=0.5,size=.2,fatten = .2) +
facet_wrap(~facet_lab,nrow=2) +
theme_bw() +
geom_vline(xintercept = 21.5, lty = 2,col="red") +
geom_hline(yintercept = 0,lty=2) +
ylab("Effect on Demographic Context on Feeling Welcome") +
xlab("National Origin Group Excluded") +
theme(legend.direction = "horizontal",
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text.x = element_text(size=8, angle = 15, hjust = 1),
axis.text.y = element_text(size=8),
legend.text = element_text(size = 12)) +
scale_x_discrete(limits=c(factor(seq(1:23))),
labels = c("1"="Afghanistan",
"2"="Albania",
"3"="Algeria",
"4"="Armenia",
"5"="Bosnia",
"6"="Eritrea",
"7"="Gambia",
"8"="Georgia",
"9"="India",
"10"="Iraq",
"11"="Iran",
"12"="Kosovo",
"13"="Macedonia",
"14"="Nigeria",
"15"="Pakistan",
"16"="Russia",
"17"="Serbia",
"18"="Somalia",
"19"="Syria",
"20"="Ukraine",
"21"="Other",
"0" ="Retain All",
"-1" = "Retain Only Syria")) +
coord_flip()
ggplot(df) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower95,ymax=Upper95),lwd=0.25,fatten = .2) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower90,ymax=Upper90),lwd=0.5,size=.2,fatten = .2) +
facet_wrap(~facet_lab,nrow=2) +
theme_bw() +
geom_vline(xintercept = 0.5, lty = 2,col="red") +
geom_hline(yintercept = 0,lty=2) +
ylab("Effect on Demographic Context on Feeling Welcome") +
xlab("National Origin Group Excluded") +
theme(legend.direction = "horizontal",
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text.x = element_text(size=8, angle = 15, hjust = 1),
axis.text.y = element_text(size=8),
legend.text = element_text(size = 12)) +
scale_x_discrete(limits=c(factor(seq(1:23))),
labels = c("1"="Afghanistan",
"2"="Albania",
"3"="Algeria",
"4"="Armenia",
"5"="Bosnia",
"6"="Eritrea",
"7"="Gambia",
"8"="Georgia",
"9"="India",
"10"="Iraq",
"11"="Iran",
"12"="Kosovo",
"13"="Macedonia",
"14"="Nigeria",
"15"="Pakistan",
"16"="Russia",
"17"="Serbia",
"18"="Somalia",
"19"="Syria",
"20"="Ukraine",
"21"="Other",
"0" ="Retain All",
"-1" = "Retain Only Syria")) +
coord_flip()
png("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/5q.Robustness, Leave-One-Out CoB/Plot/LOO.png",
width=10,height=12,units='in',res=300)
ggplot(df) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower95,ymax=Upper95),lwd=0.25,fatten = .2) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower90,ymax=Upper90),lwd=0.5,size=.2,fatten = .2) +
facet_wrap(~facet_lab,nrow=2) +
theme_bw() +
geom_vline(xintercept = 21.5, lty = 2,col="red") +
geom_hline(yintercept = 0,lty=2) +
ylab("Effect on Demographic Context on Feeling Welcome") +
xlab("National Origin Group Excluded") +
theme(legend.direction = "horizontal",
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text.x = element_text(size=8, angle = 15, hjust = 1),
axis.text.y = element_text(size=8),
legend.text = element_text(size = 12)) +
scale_x_discrete(limits=c(factor(seq(1:23))),
labels = c("1"="Afghanistan",
"2"="Albania",
"3"="Algeria",
"4"="Armenia",
"5"="Bosnia",
"6"="Eritrea",
"7"="Gambia",
"8"="Georgia",
"9"="India",
"10"="Iraq",
"11"="Iran",
"12"="Kosovo",
"13"="Macedonia",
"14"="Nigeria",
"15"="Pakistan",
"16"="Russia",
"17"="Serbia",
"18"="Somalia",
"19"="Syria",
"20"="Ukraine",
"21"="Other Nationality",
"22" ="Retain All",
"23" = "Retain Only Syria")) +
coord_flip()
dev.off()
####
#### Eroll Kuhn & Rahsaan Maxwell
#### Main Plot
### 10.2020
rm(list=ls())
library(tidyverse)
library(gridExtra)
# read in frame
df <- read.csv("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/5q.Robustness, Leave-One-Out CoB/Plot/TableForPlot.csv")
# pre-processing
df <- data.frame(df)
#df <- subset(df,df$CoB.Excluded!=23)
df$facet_lab <- ifelse(df$Variable=="% Foreign-Born",1,
ifelse(df$Variable=="% Non-EU Foreign-Born",2,
ifelse(df$Variable=="% from Arabic-Speaking Countries",3,
ifelse(df$Variable=="% Co-National",4,NA))))
df$facet_lab <- factor(df$facet_lab,
levels = c(1,2,3,4),
labels = c("% Foreign-Born",
"% Non-EU Foreign-Born",
"% from Arabic-Speaking Countries",
"% Co-National"))
ggplot(df) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower95,ymax=Upper95),lwd=0.25,fatten = .2) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower90,ymax=Upper90),lwd=0.5,size=.2,fatten = .2) +
facet_wrap(~facet_lab,nrow=2) +
theme_bw() +
geom_vline(xintercept = 21.5, lty = 2,col="red") +
geom_hline(yintercept = 0,lty=2) +
ylab("Effect on Demographic Context on Feeling Welcome") +
xlab("National Origin Group Excluded") +
theme(legend.direction = "horizontal",
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text.x = element_text(size=8, angle = 15, hjust = 1),
axis.text.y = element_text(size=8),
legend.text = element_text(size = 12)) +
scale_x_discrete(limits=c(factor(seq(1:23))),
labels = c("1"="Afghanistan",
"2"="Albania",
"3"="Algeria",
"4"="Armenia",
"5"="Bosnia",
"6"="Eritrea",
"7"="Gambia",
"8"="Georgia",
"9"="India",
"10"="Iraq",
"11"="Iran",
"12"="Kosovo",
"13"="Macedonia",
"14"="Nigeria",
"15"="Pakistan",
"16"="Russia",
"17"="Serbia",
"18"="Somalia",
"19"="Syria",
"20"="Ukraine",
"21"="Other Nationality",
"22" ="Retain All",
"23" = "Retain Only Syria")) +
coord_flip()
png("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/5q.Robustness, Leave-One-Out CoB/Plot/LOO.png",
width=10,height=12,units='in',res=300)
ggplot(df) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower95,ymax=Upper95),lwd=0.25,fatten = .2) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower90,ymax=Upper90),lwd=0.5,size=.2,fatten = .2) +
facet_wrap(~facet_lab,nrow=2) +
theme_bw() +
geom_vline(xintercept = 21.5, lty = 2,col="red") +
geom_hline(yintercept = 0,lty=2) +
ylab("Effect on Demographic Context on Feeling Welcome") +
xlab("National Origin Group Excluded") +
theme(legend.direction = "horizontal",
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text.x = element_text(size=8, angle = 15, hjust = 1),
axis.text.y = element_text(size=8),
legend.text = element_text(size = 12)) +
scale_x_discrete(limits=c(factor(seq(1:23))),
labels = c("1"="Afghanistan",
"2"="Albania",
"3"="Algeria",
"4"="Armenia",
"5"="Bosnia",
"6"="Eritrea",
"7"="Gambia",
"8"="Georgia",
"9"="India",
"10"="Iraq",
"11"="Iran",
"12"="Kosovo",
"13"="Macedonia",
"14"="Nigeria",
"15"="Pakistan",
"16"="Russia",
"17"="Serbia",
"18"="Somalia",
"19"="Syria",
"20"="Ukraine",
"21"="Other Nationality",
"22" ="Retain All",
"23" = "Retain Only Syria")) +
coord_flip()
dev.off()
####
#### Eroll Kuhn & Rahsaan Maxwell
#### Main Plot
### 10.2020
rm(list=ls())
library(tidyverse)
library(gridExtra)
# read in frame
df <- read.csv("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/5q.Robustness, Leave-One-Out CoB/Plot/TableForPlot.csv")
# pre-processing
df <- data.frame(df)
####
#### Eroll Kuhn & Rahsaan Maxwell
#### Main Plot
### 10.2020
rm(list=ls())
library(tidyverse)
library(gridExtra)
# read in frame
df <- read.csv("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V8/5q.Robustness, Leave-One-Out CoB/Plot/TableForPlot.csv")
# pre-processing
df <- data.frame(df)
#df <- subset(df,df$CoB.Excluded!=23)
df <- subset(df, df$Variable)
df$Variable
rm(list=ls())
library(tidyverse)
library(gridExtra)
# read in frame
df <- read.csv("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V8/5q.Robustness, Leave-One-Out CoB/Plot/TableForPlot.csv")
# pre-processing
df <- data.frame(df)
#df <- subset(df,df$CoB.Excluded!=23)
df <- subset(df, df$Variable !="% from Arabic-Speaking Countries")
rm(list=ls())
library(tidyverse)
library(gridExtra)
# read in frame
df <- read.csv("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V8/5q.Robustness, Leave-One-Out CoB/Plot/TableForPlot.csv")
# pre-processing
df <- data.frame(df)
#df <- subset(df,df$CoB.Excluded!=23)
df <- subset(df, df$Variable !="% from Arabic-Speaking Countries")
df$facet_lab <- ifelse(df$Variable=="% Foreign-Born",1,
ifelse(df$Variable=="% Non-EU Foreign-Born",2,
#ifelse(df$Variable=="% from Arabic-Speaking Countries",3,
ifelse(df$Variable=="% Co-National",4,NA)))
df$facet_lab <- factor(df$facet_lab,
levels = c(1,2,3),
labels = c("% Foreign-Born",
"% Non-EU Foreign-Born",
"% Co-National"))
ggplot(df) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower95,ymax=Upper95),lwd=0.25,fatten = .2) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower90,ymax=Upper90),lwd=0.5,size=.2,fatten = .2) +
facet_wrap(~facet_lab,nrow=2) +
theme_bw() +
geom_vline(xintercept = 21.5, lty = 2,col="red") +
geom_hline(yintercept = 0,lty=2) +
ylab("Effect on Demographic Context on Feeling Welcome") +
xlab("National Origin Group Excluded") +
theme(legend.direction = "horizontal",
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text.x = element_text(size=8, angle = 15, hjust = 1),
axis.text.y = element_text(size=8),
legend.text = element_text(size = 12)) +
scale_x_discrete(limits=c(factor(seq(1:23))),
labels = c("1"="Afghanistan",
"2"="Albania",
"3"="Algeria",
"4"="Armenia",
"5"="Bosnia",
"6"="Eritrea",
"7"="Gambia",
"8"="Georgia",
"9"="India",
"10"="Iraq",
"11"="Iran",
"12"="Kosovo",
"13"="Macedonia",
"14"="Nigeria",
"15"="Pakistan",
"16"="Russia",
"17"="Serbia",
"18"="Somalia",
"19"="Syria",
"20"="Ukraine",
"21"="Other Nationality",
"22" ="Retain All",
"23" = "Retain Only Syria")) +
coord_flip()
ggplot(df) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower95,ymax=Upper95),lwd=0.25,fatten = .2) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower90,ymax=Upper90),lwd=0.5,size=.2,fatten = .2) +
facet_wrap(~facet_lab,nrow=1) +
theme_bw() +
geom_vline(xintercept = 21.5, lty = 2,col="red") +
geom_hline(yintercept = 0,lty=2) +
ylab("Effect on Demographic Context on Feeling Welcome") +
xlab("National Origin Group Excluded") +
theme(legend.direction = "horizontal",
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text.x = element_text(size=8, angle = 15, hjust = 1),
axis.text.y = element_text(size=8),
legend.text = element_text(size = 12)) +
scale_x_discrete(limits=c(factor(seq(1:23))),
labels = c("1"="Afghanistan",
"2"="Albania",
"3"="Algeria",
"4"="Armenia",
"5"="Bosnia",
"6"="Eritrea",
"7"="Gambia",
"8"="Georgia",
"9"="India",
"10"="Iraq",
"11"="Iran",
"12"="Kosovo",
"13"="Macedonia",
"14"="Nigeria",
"15"="Pakistan",
"16"="Russia",
"17"="Serbia",
"18"="Somalia",
"19"="Syria",
"20"="Ukraine",
"21"="Other Nationality",
"22" ="Retain All",
"23" = "Retain Only Syria")) +
coord_flip()
rm(list=ls())
library(tidyverse)
library(gridExtra)
# read in frame
df <- read.csv("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V8/5q.Robustness, Leave-One-Out CoB/Plot/TableForPlot.csv")
# pre-processing
df <- data.frame(df)
#df <- subset(df,df$CoB.Excluded!=23)
df <- subset(df, df$Variable !="% from Arabic-Speaking Countries")
df$facet_lab <- ifelse(df$Variable=="% Foreign-Born",1,
ifelse(df$Variable=="% Non-EU Foreign-Born",2,
#ifelse(df$Variable=="% from Arabic-Speaking Countries",3,
ifelse(df$Variable=="% Co-National",3,NA)))
df$facet_lab <- factor(df$facet_lab,
levels = c(1,2,3),
labels = c("% Foreign-Born",
"% Non-EU Foreign-Born",
"% Co-National"))
ggplot(df) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower95,ymax=Upper95),lwd=0.25,fatten = .2) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower90,ymax=Upper90),lwd=0.5,size=.2,fatten = .2) +
facet_wrap(~facet_lab,nrow=1) +
theme_bw() +
geom_vline(xintercept = 21.5, lty = 2,col="red") +
geom_hline(yintercept = 0,lty=2) +
ylab("Effect on Demographic Context on Feeling Welcome") +
xlab("National Origin Group Excluded") +
theme(legend.direction = "horizontal",
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text.x = element_text(size=8, angle = 15, hjust = 1),
axis.text.y = element_text(size=8),
legend.text = element_text(size = 12)) +
scale_x_discrete(limits=c(factor(seq(1:23))),
labels = c("1"="Afghanistan",
"2"="Albania",
"3"="Algeria",
"4"="Armenia",
"5"="Bosnia",
"6"="Eritrea",
"7"="Gambia",
"8"="Georgia",
"9"="India",
"10"="Iraq",
"11"="Iran",
"12"="Kosovo",
"13"="Macedonia",
"14"="Nigeria",
"15"="Pakistan",
"16"="Russia",
"17"="Serbia",
"18"="Somalia",
"19"="Syria",
"20"="Ukraine",
"21"="Other Nationality",
"22" ="Retain All",
"23" = "Retain Only Syria")) +
coord_flip()
png("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V8/5q.Robustness, Leave-One-Out CoB/Plot/LOO.png",
width=10,height=12,units='in',res=300)
ggplot(df) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower95,ymax=Upper95),lwd=0.25,fatten = .2) +
geom_pointrange(aes(x=CoB.Excluded,y=Coef,ymin=Lower90,ymax=Upper90),lwd=0.5,size=.2,fatten = .2) +
facet_wrap(~facet_lab,nrow=1) +
theme_bw() +
geom_vline(xintercept = 21.5, lty = 2,col="red") +
geom_hline(yintercept = 0,lty=2) +
ylab("Effect on Demographic Context on Feeling Welcome") +
xlab("National Origin Group Excluded") +
theme(legend.direction = "horizontal",
legend.position = "bottom",
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.text.x = element_text(size=8, angle = 15, hjust = 1),
axis.text.y = element_text(size=8),
legend.text = element_text(size = 12)) +
scale_x_discrete(limits=c(factor(seq(1:23))),
labels = c("1"="Afghanistan",
"2"="Albania",
"3"="Algeria",
"4"="Armenia",
"5"="Bosnia",
"6"="Eritrea",
"7"="Gambia",
"8"="Georgia",
"9"="India",
"10"="Iraq",
"11"="Iran",
"12"="Kosovo",
"13"="Macedonia",
"14"="Nigeria",
"15"="Pakistan",
"16"="Russia",
"17"="Serbia",
"18"="Somalia",
"19"="Syria",
"20"="Ukraine",
"21"="Other Nationality",
"22" ="Retain All",
"23" = "Retain Only Syria")) +
coord_flip()
dev.off()
